package org.javamap;


/**
  * A location on the JavaMap.
  */
public class Location implements java.io.Serializable
{
	public final static int INVALID = -1;
	
	
	public int row, col, depth;
	
	public Location()
	{
		row = col = depth = INVALID;
	}
	
	public Location(int row, int col, int depth)
	{
		this.row = row;
		this.col = col;
		this.depth = depth;
	}
	
	public boolean equals(Object _rhs)
	{
		Location rhs = (Location) _rhs;
		return rhs.row == row && rhs.col == col && rhs.depth == depth;
	}
	
	public Location set(Object _rhs)
	{
		Location rhs = (Location) _rhs;
		row = rhs.row; col = rhs.col; depth = rhs.depth;
		return this;
	}
	
	public String toString()
	{
		return "("+row+','+col+','+depth+')';
	}
}
